// "".match(/\d+/g)
const _ = require("lodash");

const match = _.curry(function(reg,str){
  return str.match(reg);
})

const matchSpace = match(/\s+/g);
const matchNumber = match(/\d+/g);

console.log(matchNumber("dadas2131das312"));

const filter = _.curry(function(fn,array){
  return array.filter(fn)
})
console.log(filter(matchSpace,["hsjdh  fsdfkjdsh fsdf","djsdf"]));
const filterSpace = filter(matchSpace);
console.log(filterSpace(["hsjdh  fsdfkjdsh fsdf","djsdf"]))
console.log(filter(matchNumber,["dasd13sd","dasdas"]))
const filterNum = filter(matchNumber);
console.log(filterNum(["dasd13sd","dasdas"]))
